#!/bin/bash

if (( $EUID != 0 )); then
  echo "Eseguire lo script come amministratore"
  exit
fi

# scarico chiave GPG e la installo
wget -qO- https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor > /tmp/packages.microsoft.gpg
install -D -o root -g root -m 644 /etc/packages.microsoft.gpg /etc/apt/keyrings/packages.microsoft.gpg

# aggiungo il repository
echo "deb [arch=amd64,arm64,armhf signed-by=/etc/apt/keyrings/packages.microsoft.gpg] https://packages.microsoft.com/repos/code stable main" > /etc/apt/sources.list.d/vscode.list

# aggiorno apt
apt-get update

# installo vscodium
apt-get install --yes code
